package com.google.code.jtasks.client.ui.commands;

import com.google.code.jtasks.client.ui.Command;
import com.google.code.jtasks.client.ui.ScreenHelper;
import com.google.inject.Inject;

/**
 * Команда по умолчанию. Выводит сообщение о неизвестной команде.
 */
public class DefaultCommand implements Command {
    private final ScreenHelper helper;

    @Inject
    DefaultCommand(ScreenHelper helper) {
        this.helper = helper;
    }

    @Override
    public String name() {
        return "Default command";
    }

    @Override
    public String description() {
        return "Default command which is executed when no other command has been found";
    }

    @Override
    public void execute() {
        helper.drawString(5, 2, "Unknown command!");
        helper.refresh();
        helper.readKey();
    }
}
